Accord Software, Inc.

tutorial03/str_array.c




/*
 * Accord Software, Inc.
 *
 * Tutorial 03 - CIDL file.
 *
 * This tutorial shows how array of strings are 
 * specified in CIDL.
 */

#include "str_array.h"

/* 
 * Null terminated array of strings.
 */

int 
print_all(months)
	char *months[];
{
	int j = 0;

	while (months[j]) {
		printf("months[%d] = %s\n", j, months[j]);
		j++;
	}
	return j;
}

/* 
 * Counted array of strings.
 */

int
print_qtr(months)
	char *months[QUARTER];
{
	int j = 0;

	while (j < QUARTER) {
		printf("months[%d] = %s\n", j, months[j]);
		j++;
	}
	return j;
}

[ Home | Tutorials | main.c | str_array.h ]
E-Mail:webmaster@accord.com
[P-044] Updated March 14, 1996
Copyright © 1993-1996 Accord Software, Inc. All rights reserved.